package com.ruoyi.function.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.function.mapper.EtcGantryTreeMapper;
import com.ruoyi.function.domain.EtcGantryTree;
import com.ruoyi.function.service.IEtcGantryTreeService;

/**
 * ETC门架区间数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-11
 */
@Service
public class EtcGantryTreeServiceImpl implements IEtcGantryTreeService 
{
    @Autowired
    private EtcGantryTreeMapper etcGantryTreeMapper;

    /**
     * 查询ETC门架区间数据
     * 
     * @param id ETC门架区间数据主键
     * @return ETC门架区间数据
     */
    @Override
    public EtcGantryTree selectEtcGantryTreeById(Long id)
    {
        return etcGantryTreeMapper.selectEtcGantryTreeById(id);
    }

    /**
     * 查询ETC门架区间数据列表
     * 
     * @param etcGantryTree ETC门架区间数据
     * @return ETC门架区间数据
     */
    @Override
    public List<EtcGantryTree> selectEtcGantryTreeList(EtcGantryTree etcGantryTree)
    {
        return etcGantryTreeMapper.selectEtcGantryTreeList(etcGantryTree);
    }

    /**
     * 新增ETC门架区间数据
     * 
     * @param etcGantryTree ETC门架区间数据
     * @return 结果
     */
    @Override
    public int insertEtcGantryTree(EtcGantryTree etcGantryTree)
    {
        return etcGantryTreeMapper.insertEtcGantryTree(etcGantryTree);
    }

    /**
     * 修改ETC门架区间数据
     * 
     * @param etcGantryTree ETC门架区间数据
     * @return 结果
     */
    @Override
    public int updateEtcGantryTree(EtcGantryTree etcGantryTree)
    {
        return etcGantryTreeMapper.updateEtcGantryTree(etcGantryTree);
    }

    /**
     * 批量删除ETC门架区间数据
     * 
     * @param ids 需要删除的ETC门架区间数据主键
     * @return 结果
     */
    @Override
    public int deleteEtcGantryTreeByIds(Long[] ids)
    {
        return etcGantryTreeMapper.deleteEtcGantryTreeByIds(ids);
    }

    /**
     * 删除ETC门架区间数据信息
     * 
     * @param id ETC门架区间数据主键
     * @return 结果
     */
    @Override
    public int deleteEtcGantryTreeById(Long id)
    {
        return etcGantryTreeMapper.deleteEtcGantryTreeById(id);
    }

    /**
     * 是否存在子节点
     * 
     * @param id 节点ID
     * @return 结果 true 存在 false 不存在
     */
    @Override
    public boolean hasChildById(Long id)
    {
        int result = etcGantryTreeMapper.hasChildById(id);
        return result > 0;
    }
}
